<?php

namespace App\Models\GameDB\Frag;

use Illuminate\Database\Eloquent\Model;

class AppointGift extends Model
{
    public $connection = 'mysql_game';

    protected $table = 'lottery_frag_appoint_gift';

    protected $fillable = [
        'id', 'user_id', 'gift_id', 'is_valid',
    ];

    public function gift()
    {
        return $this->hasOne(\App\Models\MainDB\Gift::class, 'id', 'gift_id');
    }

    public function user()
    {
        return $this->hasOne(\App\Models\MainDB\User::class, 'user_id', 'user_id');
    }

    public function user_data()
    {
        return $this->hasOne(\App\Models\MainDB\UserData::class, 'user_id', 'user_id');
    }

    public function admin()
    {
        return $this->hasOne(\App\Models\GameDB\Admin::class, 'auth_id', 'admin_id');
    }

}
